<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Login</title>
    </head>
    <body>
        <?php include_once '../PlantillasUI/_MainLayout.php'; ?>
        <?php include_once '../Model/usuarioDao.php';?>
        <div class="row">
             <div class="col-xs-3 col-sm-2"></div>
             <div class="col-xs-12 col-sm-8">
                 <div id="wrapper">
                    <form class="form-horizontal" role="form" method="post" action="../Controller/changePassController.php">
             <?php 
                if(isset($_SESSION['usuario']))
                    $user = $_SESSION['usuario'];
                echo '<input type="hidden" class="form-control" id="user" name="user" value="'.$user.'">';
            ?>
        <div class="row">
            <div class="col-md-2"></div>
            <div class="col-xs-12 col-sm-12 col-md-8">
                <div class="table-responsive">
                    
                </div>
            </div>
        </div>
            <br/>
            <!--<div class="row">
             <div class="col-xs-3 col-sm-2"></div>
             <div class="col-xs-12 col-sm-8">
                 <div id="wrapper">
                    <form class="form-horizontal" role="form" method="post" action="../Controller/usersController.php">-->
                        <div class="form-group">
                           <div class="col-sm-4"></div>
                           <div class="col-sm-4">
                               <label><h1><font color="white"><strong>Change Password</strong></font></h1></label>
                           </div>
                           <div class="col-sm-4"></div>
                        </div>
                        
                        <div class="form-group">
                           <div class="col-sm-4"></div>
                           <div class="col-sm-4">
                               <label><font color="white">User Name</font></label>
                               <?php 
                               //echo $band;
                               //echo $_GET['acc'];
                               
                                    echo '<input type="text" class="form-control" id="userName" name="userName" placeholder="User Name" value="'.$_GET['us'].'">';
                                    ?>
                           </div>
                           <div class="col-sm-4"></div>
                        </div>
                        <div class="form-group">
                           <div class="col-sm-4"></div>
                           <div class="col-sm-4">
                               <?php
                               echo '<input type="text" class="form-control" id="passWord" name="passWord" placeholder="Password">';
                                ?>
                           </div>
                           <div class="col-sm-4"></div>
                        </div>
                        <br/>
                        <div class="col-sm-4"></div>
                        <div class="col-sm-2">
                            <input id="submit" type="image" value="submit" src="../Resources/img/btn_enter.png" alt="Enter" class="enterButton">
                        </div>
                        <div class="col-sm-4"></div>
                    </form>
                <br/><br/><br/>
                 </div>
             </div>
             <div class="col-xs-3 col-sm-2"></div>
        </div>
        <?php include_once '../PlantillasUI/_footerLayout.php'; ?>
        <?php
              
        ?>
        <script type="text/javascript">
            
            $('#submit').click(function(event) {
                event.preventDefault();
                var hash = CryptoJS.SHA3($('#passWord').val());
                $('#passWord').val(hash.toString(CryptoJS.enc.Hex));
                $('.form-horizontal').submit();
            });
            
    </script>
    </body>
</html>